
import React from 'react'
import {View,Text,TextInput} from 'react-native'

import StorageUtils from './StorageUtil'

export default  class StorageTs extends React.Component{

    constructor(props) {
        super(props);
        this.state = {
            text: '请输入你要存储的数据',
        };
    }

    render(){
        return(<View style={{flex:1}}>
            <TextInput
                style={{height: 40, borderColor: 'gray', borderWidth: 1}}
                onChangeText={(text) => this.setState({text})}
                value={this.state.text}
            />
            <Text style={{width:'100%',height:50, color:'#cf151b'}}
                  onPress={()=>{StorageUtils._sava('bo',this.state.text)}}>存数据</Text>

            <Text style={{width:'100%',height:50, color:'#cf151b'}}
                  onPress={()=>{StorageUtils._load('bo',(params)=>{alert(params)})}}>取数据</Text>
        </View>)

    }
}